<?php
include '../variables/varConector.php';


include '../funciones/funciones.php';
echo "<div style=\"padding-left: 80px; padding-right: 80px; padding-top: 20px;\" align=\"center\">";
cadenaFondoAzul("Viajes por Liquidar");
echo "</div>";
?>
<div style="padding-left: 0px; padding-right: 0px; padding-top: 15px;">
       <div align="center">

              <table>
                     <tr align="center">
                            <td><b>Dueño</b></td>
                            <td><b>Chofer</b></td>
                            <td><b>Placa</b></td>
                            <td><b>Guia</b></td>
                            <td><b>Kilos</b></td>
                            <td><b>Rubro</b></td>
                            <td><b>Peaje</b></td>
                            <td><b>Destino</b></td>
                            <td><b>Fecha</b></td>
                     </tr>
<?php

       $conector = mysql_connect(HOST, USUARIO, PASSWORD);
       mysql_select_db(BD, $conector);
       $sql = "SELECT chofer, placa, guia, kilos, rubro, peaje, sucursal.nombre, fecha, socio.nombre
              FROM viaje, sucursal, camion, socio WHERE idSucursalRef = sucursal.id AND
              idCamionRef = camion.id AND idSocioRef = socio.id AND liquidacion = '0' ORDER BY 
              sucursal.nombre ASC,  fecha ASC, guia ASC";
       $resultado = mysql_query($sql, $conector);
       mysql_close($conector);

       $cantidad = mysql_num_rows($resultado);

       for ($i = 1; $i <= $cantidad; $i++) {
              $linea = @mysql_fetch_row($resultado);
              if ($i % 2 == 0) {
?>
                     <tr class="zebraPar"  align="center">
                            <td><?php echo $linea["8"]; ?></td>
                            <td><?php echo $linea["0"]; ?></td>
                            <td><?php echo $linea["1"]; ?></td>
                            <td><?php echo $linea["2"]; ?></td>
                            <td><?php echo $linea["3"]; ?></td>
                            <td><?php echo $linea["4"]; ?></td>
                            <td><?php echo $linea["5"]; ?></td>
                            <td><?php echo $linea["6"]; ?></td>
                            <td><?php echo $linea["7"]; ?></td>
                     </tr>
<?php
              } else {
?>
                     <tr class="zebraImpar" align="center">
                            <td><?php echo $linea["8"]; ?></td>
                            <td><?php echo $linea["0"]; ?></td>
                            <td><?php echo $linea["1"]; ?></td>
                            <td><?php echo $linea["2"]; ?></td>
                            <td><?php echo $linea["3"]; ?></td>
                            <td><?php echo $linea["4"]; ?></td>
                            <td><?php echo $linea["5"]; ?></td>
                            <td><?php echo $linea["6"]; ?></td>
                            <td><?php echo $linea["7"]; ?></td>
                     </tr>
<?php
              }
       }
?>

              </table>
       </div>
</div>
